package ro.isdc.vms.vehicleinstance.domain;

import ro.isdc.vms.misc.domain.Entity;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * Descriptive information relating to a specific instance of a vehicle.
 * 
 * @author Andrei.Chirila
 */
public class VehicleInstance extends Entity {
	
	/**
	 * Generated Serial Version UID
	 */
	private static final long serialVersionUID = -7361662471926515362L;
	
	/**
	 * A nation-wide unique vehicle instance 17 character formatted identification 
	 * text. 
	 */
	private String vehicleIdentificationNumber;
	
	/**
	 * License/registration plate number. The license plate number is also 
	 * referred to as vehicle registration mark (VRM).
	 */
	private String licensePlate;
	
	/**
	 * Vehicle make
	 */
	private VehicleMake vehicleMake;
	
	/**
	 * Vehicle model
	 */
	private VehicleModel vehicleModel;
	
	/**
	 * Vehicle type
	 */
	private VehicleType vehicleType;
	
	/**
	 * Information relating to the registration and registration context of this
	 * vehicle.
	 */
	private VehicleRegistration registration;
	
	/**
	 * @return the vehicleIdentificationNumber
	 */
	public String getVehicleIdentificationNumber() {
		return vehicleIdentificationNumber;
	}
	
	/**
	 * @param vehicleIdentificationNumber the vehicleIdentificationNumber to set
	 */
	public void setVehicleIdentificationNumber(final String vehicleIdentificationNumber) {
		this.vehicleIdentificationNumber = vehicleIdentificationNumber;
	}
	
	/**
	 * @return the licensePlate
	 */
	public String getLicensePlate() {
		return licensePlate;
	}
	
	/**
	 * @param licenseplate the licensePlate to set
	 */
	public void setLicensePlate(final String licensePlate) {
		this.licensePlate = licensePlate;
	}
	
	/**
	 * @return the registration
	 */
	public VehicleRegistration getRegistration() {
		return registration;
	}

	/**
	 * @param registration the registration to set
	 */
	public void setRegistration(final VehicleRegistration registration) {
		this.registration = registration;
	}

	/**
	 * @return the vehicleMake
	 */
	public VehicleMake getVehicleMake() {
		return vehicleMake;
	}

	/**
	 * @param vehicleMake the vehicleMake to set
	 */
	public void setVehicleMake(final VehicleMake vehicleMake) {
		this.vehicleMake = vehicleMake;
	}

	/**
	 * @return the vehicleModel
	 */
	public VehicleModel getVehicleModel() {
		return vehicleModel;
	}

	/**
	 * @param vehicleModel the vehicleModel to set
	 */
	public void setVehicleModel(final VehicleModel vehicleModel) {
		this.vehicleModel = vehicleModel;
	}

	/**
	 * @return the vehicleType
	 */
	public VehicleType getVehicleType() {
		return vehicleType;
	}

	/**
	 * @param vehicleType the vehicleType to set
	 */
	public void setVehicleType(final VehicleType vehicleType) {
		this.vehicleType = vehicleType;
	}

	/**
	 * @see java.lang.Object#toString()
	 */
	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE).append(
				"createdBy", this.getCreatedBy()).append("registration",
				this.registration).append("vehicleIdentificationNumber",
				this.vehicleIdentificationNumber).append("vehicleMake",
				this.vehicleMake).append("creationTimestamp",
				this.getCreationTimestamp()).append("vehicleModel",
				this.vehicleModel).append("entityId", this.getEntityId())
				.append("oldFlaggedTimestamp", this.getOldFlaggedTimestamp())
				.append("lastUpdatedBy", this.getLastUpdatedBy()).append(
						"deletionTimestamp", this.getDeletionTimestamp())
				.append("versionNo", this.getVersionNo()).append(
						"licensePlate", this.licensePlate).append(
						"vehicleType", this.vehicleType).append(
						"lastUpdateTimestamp", this.getLastUpdateTimestamp())
				.toString();
	}
	
}
